package com.cqhfan.core.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

import java.util.Objects;

/**
 * @author 眭传洪
 * @create 2025-08-14 16:14
 */
@Getter
public enum LikedRecordTypeEnum {
    WORKS(1, "works"),
    WORKS_COMMENT(2, "worksComment")
    ;
    LikedRecordTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @JsonValue
    @EnumValue
    final Integer value;

    final String desc;

    public static LikedRecordTypeEnum valueOf(Integer value) {
        if (Objects.equals(value, WORKS.getValue())) {
            return WORKS;
        } else if (Objects.equals(value, WORKS_COMMENT.getValue())) {
            return WORKS_COMMENT;
        } else {
            return null;
        }
    }
}
